package com.storm;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * this class used to save the software info
 * @author liuquan
 *
 */
public class SysPros {

	private static Properties sysPros = new Properties();
	static{
		load();
	}
	public static void load(){
		InputStream in = ClassLoader.getSystemResourceAsStream("SystemPros.properties");  
		try {
			sysPros.load(in);
			in.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			
		}
		
	}
	
	public static String getProperty(String key){
		String ret = null;
		if(key == null || key.equals("")){
			return null;
		}
		ret = sysPros.getProperty(key);
		return ret;
	}
	public static void setProperty(String key,String value){
		sysPros.setProperty(key, value);
	}
	public static void main(String[] args){
//		SysPros.load();
		System.out.println(SysPros.getProperty("MailSender"));
	}
}
